package com.jic.order.controller.manage;

import com.alibaba.fastjson.JSON;
import com.jic.common.base.vo.Page;
import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.order.manage.response.OrderReturnGoodRecordResponse;
import com.jic.order.manage.request.OrderReturnGoodRecordRequest;

import com.jic.order.service.OrderReturnGoodRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@Api(tags = "订单换货发货记录")
@RequestMapping(value = "orderReturnGoodRecord")
@RestController
public class OrderReturnGoodRecordController {

	@Autowired
	OrderReturnGoodRecordService orderReturnGoodRecordService;

	@ApiOperation(value = "获取订单退货记录")
	@ResponseBody
	@PostMapping(value = "/queryPage")
	public RestResult<PageResult<OrderReturnGoodRecordResponse>> queryPage(@RequestBody OrderReturnGoodRecordRequest form) {
		log.info("开始调用订单拆分分页，{}", JSON.toJSONString(form));
		Page page = new Page();
		page.setLimit(form.getLimit());
		page.setStart(form.getStart());
		return RestResult.success(orderReturnGoodRecordService.queryPage(form, page));

	}
}
